---
title: clsClaimTaskGenerator
summary: API reference for clsClaimTaskGenerator.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks.Claim
reference_type: embedded
---

# clsClaimTaskGenerator

`clsClaimTaskGenerator` is a batch-creation facade — despite inheriting `clsBusinessBase`, it is not itself a persisted business object. It wraps an internal `clsClaimTaskCollection` and forwards validation/persistence state, giving other applications a single API to raise workflow tasks in bulk without knowing the underlying task object model.

## Purpose
- Assembles and persists many claim tasks in one collection ([Bulk-raise claim tasks](../../operations/op-2-bulk-raise-claim-tasks.md)).
- Normalizes due dates to working days across every `AddTask` overload ([BR-GEN-02](../../business-rules.md#br-gen-02-generated-task-due-date-normalized-to-a-working-day)).
- Resolves a default assignee and default create user when the caller omits them ([BR-GEN-03](../../business-rules.md#br-gen-03-default-assignee-is-the-responsible-adjuster), [BR-GEN-04](../../business-rules.md#br-gen-04-default-create-user-is-the-data-portal-user)).
- Converts between `TaskPriority` and priority code strings ([Convert between priority codes and enum values](../../operations/op-17-convert-priority-codes.md)).

## Context
- Namespace: `SAIF.Business.Tasks.Claim`
- Assembly/package: `SAIF.Business.Tasks.Claim.dll` (embedded)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `PRIORITY_HIGH` | `Public Const PRIORITY_HIGH As String = "HIGH"` | Priority code constant for high-priority tasks. |
| `PRIORITY_MEDIUM` | `Public Const PRIORITY_MEDIUM As String = "MED"` | Priority code constant for medium-priority tasks. |
| `PRIORITY_URGENT` | `Public Const PRIORITY_URGENT As String = "URG"` | Priority code constant for urgent tasks. |
| `PRIORITY_LOW` | `Public Const PRIORITY_LOW As String = "LOW"` | Priority code constant for low-priority tasks. |
| `PRIORITY_INFORMATIONAL` | `Public Const PRIORITY_INFORMATIONAL As String = "INFO"` | Priority code constant used for informational messages and unmapped priority values ([BR-GEN-06](../../business-rules.md#br-gen-06-unrecognized-priority-values-default-silently)). |
| `New(dpi)` | `Public Sub New(dpi As IDataPortalInfo)` | Constructs the generator bound to the data portal, defaulting the create user. |
| `New(createUser, dpi)` | `Public Sub New(createUser As String, dpi As IDataPortalInfo)` | Constructs the generator with an explicit create user. |
| `New(dpi, claimId, [createUser])` | `Public Sub New(dpi As IDataPortalInfo, claimId As Integer, Optional createUser As String = "")` | Constructs the generator pre-bound to a claim by ID. |
| `New(dpi, claimNumber, [createUser])` | `Public Sub New(dpi As IDataPortalInfo, claimNumber As String, Optional createUser As String = "")` | Constructs the generator pre-bound to a claim by claim number. |
| `New(dpi, clsClaimData, [createUser])` | `Public Sub New(dpi As IDataPortalInfo, claimData As clsClaimData, Optional createUser As String = "")` | Constructs the generator with a pre-loaded claim data object to avoid a redundant claim lookup. |
| `Count` | `Public ReadOnly Property Count As Integer` | Returns the number of tasks queued in the inner collection. |
| `Tasks` | `Public ReadOnly Property Tasks As clsClaimTaskCollection` | Exposes the inner `clsClaimTaskCollection` for direct inspection. |
| `Overrides IsValid` | `Public Overrides ReadOnly Property IsValid As Boolean` | Forwards the inner collection's aggregate validity. |
| `Overrides IsDirty` | `Public Overrides ReadOnly Property IsDirty As Boolean` | Forwards the inner collection's aggregate dirty state. |
| `Shadows ErrorMessages` | `Public Shadows ReadOnly Property ErrorMessages As String` | Forwards the inner collection's accumulated validation error messages. |
| `Shadows ErrorCount` | `Public Shadows ReadOnly Property ErrorCount As Integer` | Forwards the inner collection's validation error count. |
| `AddTask(...)` (8 overloads) | `Public Function AddTask(text As String, [mailid], [dueDate/offset], [inPriority], [inClaimCategory], [inNotePadRequired]) As clsClaimTask` | Creates, validates, and queues one claim task, applying due-date normalization, assignee/category defaults, and priority conversion ([Bulk-raise claim tasks](../../operations/op-2-bulk-raise-claim-tasks.md)). |
| `Overrides Save()` | `Public Overrides Function Save() As Boolean` | Persists all queued tasks via the inner collection's `Save()`. |
| `Shadows ToXML()` | `Public Shadows Function ToXML() As String` | Serializes the inner collection to XML. |
| `Shadows GetReportXML()` | `Public Shadows Function GetReportXML() As String` | Produces a report-formatted XML representation of the inner collection. |
| `Shared GetPriorityText(TaskPriority)` | `Public Shared Function GetPriorityText(priority As TaskPriority) As String` | Maps a `TaskPriority` enum value to its priority code string, defaulting to `INFO` when unmapped ([Convert between priority codes and enum values](../../operations/op-17-convert-priority-codes.md)). |
| `Shared GetPriorityText(String)` | `Public Shared Function GetPriorityText(code As String) As TaskPriority` | Maps a priority code string back to `TaskPriority`, defaulting to `Medium` when unmapped ([Convert between priority codes and enum values](../../operations/op-17-convert-priority-codes.md)). |
| `Friend IsValidClaimID` | `Friend Function IsValidClaimID(args As clsRuleArgs) As Boolean` | Rule registered per generated task validating the claim resolves to a valid record ([BR-GEN-05](../../business-rules.md#br-gen-05-generated-tasks-claim-must-resolve-to-a-valid-claim-record)). |

## Inherited public members

Members in this section are inherited from `clsBusinessBase` in `SAIF.Business` (`SAIF.BOF.Business`). They are available on this type through inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| `MarkDirty()` | `Protected Sub MarkDirty()` | Marks the business object as modified, used by the base validation/persistence infrastructure.† | `SAIF.BOF.Business` — `clsBusinessBase` |

## Behavioral notes
- `clsClaimTaskGenerator` is not itself persisted — despite inheriting `clsBusinessBase`, its `Save()` forwards entirely to the wrapped `clsClaimTaskCollection`.
- Private `NewTask(...)` throws `ApplicationException("ClaimID not specified")` when no claim ID is available ([BR-GEN-01](../../business-rules.md#br-gen-01-generated-task-must-specify-a-claim)).

## Constraints and usage notes
- `m_CreateUser` defaults to `dpi.UserID` when the caller does not supply one at construction ([BR-GEN-04](../../business-rules.md#br-gen-04-default-create-user-is-the-data-portal-user)).

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified. Statements marked with
> † were retrieved from dependency library documentation via the Legends CLI RAG service. They
> describe inherited behavior from the indicated origin library and should be verified if the
> dependency version changes.

## Sources
- SAIF.Business.Tasks.Claim/clsClaimTaskGenerator.vb
